package com.wgu.modules.repository;

import com.wgu.entity.Type;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: w
 * @Date: 2019/7/1 15:45
 * @Version 1.0
 */
@Repository
public interface TypeRepository extends JpaRepository<Type,Long>{
    /**
     * 根据类型级别查询所有类型
     * @param level
     * @return
     */
    List<Type> findByLevel(String level);

    List<Type> findByParentIdNull();

    List<Type> findByParentIdNotNull();
}
